package com.aier.entrance.icsocket;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class ServerSocketListener implements ServletContextListener{

    private EntranceSocket es;
    
    @SuppressWarnings("deprecation")
    @Override
    public void contextDestroyed(ServletContextEvent sce) {    
        es.stop();
    }

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        es= new EntranceSocket();
        es.start();
    }

}
